// 评价任务表
package dbModel

import "time"

type EvaluateTask struct {
	Id           string    `json:"id" gorm:"primary_key; column:id; type:varchar(255)"`
	Name         string    `json:"name" gorm:"column:name; type:varchar(255)" validate:"required"`
	Desc         string    `json:"desc" gorm:"column:desc; type:text"`
	ResourceType string    `json:"resourceType" gorm:"column:resource_type; type:varchar(255)" validate:"required"`
	ResourceId   string    `json:"resourceId" gorm:"column:resource_id; type:varchar(255)" validate:"required"`
	ResourceName string    `json:"resourceName" gorm:"column:resource_name; type:varchar(255)" validate:"required"`
	TemplateId   string    `json:"templateId" gorm:"column:template_id; type:varchar(255)" validate:"required"`
	TemplateName string    `json:"templateName" gorm:"column:template_name; type:varchar(255)" validate:"required"`
	ExecStatus   int       `json:"execStatus" gorm:"column:exec_status; type:int"`     // 0-未开始 1-进行中 2-暂停中 3-已结束
	PlanDuration int       `json:"planDuration" gorm:"column:plan_duration; type:int"` // 单位秒
	RealDuration int       `json:"realDuration" gorm:"column:real_duration; type:int"`   // 单位秒
	SegmentTime  int       `json:"segmentTime" gorm:"column:segment_time; type:int"`     // 单位秒
	StartTime    *time.Time `json:"startTime" gorm:"column:start_time; type:datetime"`
	EndTime      *time.Time `json:"endTime" gorm:"column:end_time; type:datetime"`
	LastStartTime *time.Time `json:"lastStartTime" gorm:"column:last_start_time; type:datetime"`
	CreateTime   time.Time `json:"-" gorm:"column:create_time; autoCreateTime"`
	UpdateTime   time.Time `json:"-" gorm:"column:update_time; autoUpdateTime"`
}

// 数据表
func (*EvaluateTask) TableName() string {
	return "evaluate_task"
}
